<?php defined('IN_ADMIN') or exit('Access Denied!'); ?>
<!DOCTYPE html>
<html class="off">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>SuDingKe.com - 后台管理中心</title>
<link href="<?=ADMIN_STATIC_URL;?>css/reset.css" rel="stylesheet" type="text/css" />
<link href="<?=ADMIN_STATIC_URL;?>css/zh-cn-system.css" rel="stylesheet" type="text/css" />
<link href="<?=ADMIN_STATIC_URL;?>css/dialog.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="<?=ADMIN_STATIC_URL;?>css/style/zh-cn-styles1.css" title="skin-1" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="<?=ADMIN_STATIC_URL;?>css/style/zh-cn-styles2.css" title="skin-2" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="<?=ADMIN_STATIC_URL;?>css/style/zh-cn-styles3.css" title="skin-3" media="screen" />
<link rel="alternate stylesheet" type="text/css" href="<?=ADMIN_STATIC_URL;?>css/style/zh-cn-styles4.css" title="skin-4" media="screen" />
<script language="javascript" type="text/javascript" src="<?=ADMIN_STATIC_URL;?>js/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="<?=ADMIN_STATIC_URL;?>js/styleswitch.js"></script>
<script language="javascript" type="text/javascript" src="<?=ADMIN_STATIC_URL;?>js/dialog.js"></script>
<style type="text/css">
.objbody {overflow:hidden}
.ips{padding:2px;display:inline-block;margin:0 6px}
.header .logo{background-image: url("<?=STATIC_URL;?>img/admin/logo.png");
/*IE6 Hack*/filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src="<?=STATIC_URL;?>img/admin/logo.png");_background:none;}
</style>
</head>
<body scroll="no" class="objbody">
<div id="dvLockScreen" class="ScreenLock" style="display:none">
  <div id="dvLockScreenWin" class="inputpwd">
    <h5><b class="ico ico-info"></b><span id="lock_tips">锁屏状态，请重新刷新浏览器解锁</span></h5>
    <center><input type="submit" class="submit" value="" name="dosubmit" onclick="window.top.location='/admin/';"></center>
    <!--div class="input">
      <label class="lb">密码：</label>
      <input type="password" id="lock_password" class="input-text" size="24">
      <input type="submit" class="submit" value="&nbsp;" name="dosubmit" onclick="check_screenlock();return false;">
    </div-->
  </div>
</div>
<div class="header">
  <div class="logo lf"><a href="http://sudingke.com" target="_blank"><span class="invisible">SuDingKe 内容管理系统</span></a></div>
  <div class="rt-col">
    <div class="tab_style white cut_line text-r"><a href="javascript:;" onclick="lock_screen()"><img src="<?=ADMIN_STATIC_URL;?>images/icon/lockscreen.png"> 锁屏</a><span>|</span><a href="http://sudingke.com" target="_blank">速订客首页</a><span>|</span><a href="http://i.sudingke.com/bbs" target="_blank">支持论坛</a><span>|</span><a href="#" target="_blank">帮助？</a>
      <ul id="Skin">
        <li class="s1 styleswitch" rel="skin-1"></li>
        <li class="s2 styleswitch" rel="skin-2"></li>
        <li class="s3 styleswitch" rel="skin-3"></li>
        <li class="s4 styleswitch" rel="skin-4"></li>
      </ul>
    </div>
  </div>
  <div class="col-auto">
    <div class="log white cut_line">您好！<?=h($theuser->name);?>
        [<?=$theuser->getTitle();?>]<span>|</span><a href="/admin/login">[退出]</a><span>|</span>
    <a href="http://sudingke.com/" target="_blank" id="site_homepage">站点首页</a><span>|</span>
    <!--
    <a href="" target="_blank">会员中心</a><span>|</span>
    <a href="?m=search" target="_blank" id="site_search">搜索</a>
    -->
    </div>
    <ul class="nav white" id="top_menu">
      <li id="_M900" class="on top_menu"><a href="javascript:_M(0, 0, '')" hidefocus="true" style="outline:none;">我的面板</a></li>

<?php /*
      <li id="_M1" class="top_menu"><a href="javascript:_M(1,'?m=admin&c=setting&a=init')"  hidefocus="true" style="outline:none;">设置</a></li>
      <li id="_M2" class="top_menu"><a href="javascript:_M(2,'?m=admin&c=module&a=init')"  hidefocus="true" style="outline:none;">模块</a></li>
      <li id="_M4" class="top_menu"><a href="javascript:_M(4,'?m=content&c=content&a=init')"  hidefocus="true" style="outline:none;">内容</a></li>
      <li id="_M5" class="top_menu"><a href="javascript:_M(5,'?m=member&c=member&a=init')"  hidefocus="true" style="outline:none;">用户</a></li>
      <li id="_M6" class="top_menu"><a href="javascript:_M(6,'?m=template&c=style&a=init')"  hidefocus="true" style="outline:none;">界面</a></li>
      <li id="_M7" class="top_menu"><a href="javascript:_M(7,'?m=admin&c=extend&a=init_extend')"  hidefocus="true" style="outline:none;">扩展</a></li>
      <li id="_M8" class="top_menu"><a href="javascript:_M(8,'?m=admin&c=phpsso&a=menu')"  hidefocus="true" style="outline:none;">phpsso</a></li>
      <li id="_M9" class="top_menu"><a href="javascript:_M(9,'?m=admin&c=plugin&a=init')"  hidefocus="true" style="outline:none;">应用</a></li>
*/ ?>
      <li class="tab_web">
          当前城市：
      <select class="ips" onChange="location.href='http://' + this.options[this.options.selectedIndex].value + '.sudingke.com/admin/'">
        <?php
            $cities = App::getConfig('cities');
            $perfix = App::getCityPerfix();
            foreach($cities as $cid => $city){
                if($cid == $perfix){
                    echo '<option value="'.$cid.'" selected>'.$city[1].'</option>';
                }else{
                    echo '<option value="'.$cid.'">'.$city[1].'</option>';
                }
            }
        ?>
      </select>
          </li>
    </ul>
  </div>
</div>
<div id="content">
  <div class="col-left left_menu">
    <div id="Scroll">
      <div id="leftMain"></div>
    </div>
    <a href="javascript:;" id="openClose" style="outline-style: none; outline-color: invert; outline-width: medium;" hideFocus="hidefocus" class="open" title="展开与关闭"><span class="hidden">展开</span></a> </div>
  <!--微型导航: START-->
  <div class="col-1 lf cat-menu" id="display_center_id" style="display:none" height="100%">
    <div class="content">
      <iframe name="center_frame" id="center_frame" src="" frameborder="false" scrolling="auto" style="border:none" width="100%" height="auto" allowtransparency="true"></iframe>
    </div>
  </div>
  <!--微型导航: END-->
  <div class="col-auto mr8">
    <div class="crumbs">
      <div class="shortcut cu-span">
          <!--
          <a href="#" target="right"><span>生成首页</span></a>
          --><a href="/admin/shop/cache" target="right"><span>更新缓存</span></a>
          </div>
      当前位置：<span id="current_pos"></span></div>
    <div class="col-1">
      <div class="content" style="position:relative; overflow:hidden">
        <iframe name="right" id="rightMain" src="/admin/default/main" frameborder="false" scrolling="auto" style="border:none; margin-bottom:30px" width="100%" height="auto" allowtransparency="true"></iframe>
        <div class="fav-nav">
          <div id="panellist"> </div>
          <div id="paneladd"></div>
          <input type="hidden" id="menuid" value="">
          <input type="hidden" id="bigid" value="" />
          <div id="help" class="fav-help"></div>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="scroll"><a href="javascript:;" class="per" title="使用鼠标滚轴滚动侧栏" onclick="menuScroll(1);"></a><a href="javascript:;" class="next" title="使用鼠标滚轴滚动侧栏" onclick="menuScroll(2);"></a></div>
<script type="text/javascript">
if(!Array.prototype.map)
Array.prototype.map = function(fn,scope) {
  var result = [],ri = 0;
  for (var i = 0,n = this.length; i < n; i++){
    if(i in this){
      result[ri++]  = fn.call(scope ,this[i],i,this);
    }
  }
  return result;
};

var getWindowSize = function(){
return ["Height","Width"].map(function(name){
  return window["inner"+name] ||
    document.compatMode === "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ]
});
}
window.onload = function (){
    if(!+"\v1" && !document.querySelector) { // for IE6 IE7
      document.body.onresize = resize;
    } else {
      window.onresize = resize;
    }
    function resize() {
        wSize();
        return false;
    }
    $("#leftMain").load("/admin/default/menu");
}
function wSize(){
    //这是一字符串
    var str=getWindowSize();
    var strs= new Array(); //定义一数组
    strs=str.toString().split(","); //字符分割
    var heights = strs[0]-150,Body = $('body');$('#rightMain').height(heights);
    //iframe.height = strs[0]-46;
    if(strs[1]<980){
        $('.header').css('width',980+'px');
        $('#content').css('width',980+'px');
        Body.attr('scroll','');
        Body.removeClass('objbody');
    }else{
        $('.header').css('width','auto');
        $('#content').css('width','auto');
        Body.attr('scroll','no');
        Body.addClass('objbody');
    }

    var openClose = $("#rightMain").height()+39;
    $('#center_frame').height(openClose+9);
    $("#openClose").height(openClose+30);
    $("#Scroll").height(openClose-20);
    windowW();
}
wSize();
function windowW(){
    if($('#Scroll').height()<$("#leftMain").height()){
        $(".scroll").show();
    }else{
        $(".scroll").hide();
    }
}
windowW();

//左侧开关
$("#openClose").click(function(){
    if($(this).data('clicknum')==1) {
        $("html").removeClass("on");
        $(".left_menu").removeClass("left_menu_on");
        $(this).removeClass("close");
        $(this).data('clicknum', 0);
        $(".scroll").show();
    } else {
        $(".left_menu").addClass("left_menu_on");
        $(this).addClass("close");
        $("html").addClass("on");
        $(this).data('clicknum', 1);
        $(".scroll").hide();
    }
    return false;
});

function _M(shop_type, shop_id, name) {
    $("#leftMain").load("/admin/default/menu?shop_type=" +shop_type+ "&shop_id="+shop_id, {limit: 25}, function(){
       windowW();
    });

    if(shop_id){
        $("#rightMain").attr('src', "/admin/shop/home/" + shop_id);
    }else{
        $("#rightMain").attr('src', "/admin/shop/list?shop_type=" + shop_type);
    }
    //$('.top_menu').removeClass("on");
    //$('#_M'+menuid).addClass("on");

    $("#current_pos").html("<b>" + name + "</b>");

    //当点击顶部菜单后，隐藏中间的框架
    $('#display_center_id').css('display','none');
    //显示左侧菜单，当点击顶部时，展开左侧
    $(".left_menu").removeClass("left_menu_on");
    $("#openClose").removeClass("close");
    $("html").removeClass("on");
    $("#openClose").data('clicknum', 0);
    $("#current_pos").data('clicknum', 1);
}
function _MP(menuid,targetUrl,targetName) {
    $("#menuid").val(menuid);
    $("#rightMain").attr('src', targetUrl);
    $('.sub_menu').removeClass("on fb blue");
    $('#_MP'+menuid).addClass("on fb blue");
    //$.get("/admin/default/position?menuid="+menuid, function(data){
    //    $("#current_pos").html(data);
    //});
    //$("#current_pos").html(targetName);
    //$("#current_pos").data('clicknum', 1);
    ///show_help(targetUrl);
}
setInterval("session_life()", 160000);
function session_life() {
    $.get("?m=admin&c=index&a=public_session_life");
}
function lock_screen() {
    $.get("?m=admin&c=index&a=public_lock_screen");
    $('#dvLockScreen').css('display','');
}
function check_screenlock() {
    var lock_password = $('#lock_password').val();
    if(lock_password=='') {
        $('#lock_tips').html('<font color="red">密码不能为空。</font>');
        return false;
    }
    $.get("?m=admin&c=index&a=public_login_screenlock", { lock_password: lock_password},function(data){
        if(data==1) {
            $('#dvLockScreen').css('display','none');
            $('#lock_password').val('');
            $('#lock_tips').html('锁屏状态，请输入密码解锁');
        } else if(data==3) {
            $('#lock_tips').html('<font color="red">密码重试次数太多</font>');
        } else {
            strings = data.split('|');
            $('#lock_tips').html('<font color="red">密码错误，您还有'+strings[1]+'次尝试机会！</font>');
        }
    });
}
$(document).bind('keydown', 'return', function(evt){check_screenlock();return false;});

(function(){
    var addEvent = (function(){
             if (window.addEventListener) {
                return function(el, sType, fn, capture) {
                    el.addEventListener(sType, fn, (capture));
                };
            } else if (window.attachEvent) {
                return function(el, sType, fn, capture) {
                    el.attachEvent("on" + sType, fn);
                };
            } else {
                return function(){};
            }
        })(),
    Scroll = document.getElementById('Scroll');
    // IE6/IE7/IE8/Opera 10+/Safari5+
    addEvent(Scroll, 'mousewheel', function(event){
        event = window.event || event ;
        if(event.wheelDelta <= 0 || event.detail > 0) {
                Scroll.scrollTop = Scroll.scrollTop + 29;
            } else {
                Scroll.scrollTop = Scroll.scrollTop - 29;
        }
    }, false);

    // Firefox 3.5+
    addEvent(Scroll, 'DOMMouseScroll',  function(event){
        event = window.event || event ;
        if(event.wheelDelta <= 0 || event.detail > 0) {
                Scroll.scrollTop = Scroll.scrollTop + 29;
            } else {
                Scroll.scrollTop = Scroll.scrollTop - 29;
        }
    }, false);

})();
function menuScroll(num){
    var Scroll = document.getElementById('Scroll');
    if(num==1){
        Scroll.scrollTop = Scroll.scrollTop - 60;
    }else{
        Scroll.scrollTop = Scroll.scrollTop + 60;
    }
}
</script>
</body>
</html>